import request from '@/config/axios'

// 材料出库主 VO
export interface Rdrecord11VO {
  id: number // id
  serialNumber: string // 流水号
  businessType: number // 业务类型
  personId: number // 业务员id
  deptId: number // 部门id
  warehouseId: number // 仓库id
  orderDate: Date // 订单日期
  remark: string // 备注
  auditor: string // 审核人
  auditTime: Date // 审核时间
  status: number // 状态
  processInstanceId: string // 流程实例id
}

// 材料出库主 API
export const Rdrecord11Api = {
  // 查询材料出库主分页
  getRdrecord11Page: async (params: any) => {
    return await request.get({ url: `/wms/rdrecord11/page`, params })
  },

  // 查询材料出库主详情
  getRdrecord11: async (id: string) => {
    return await request.get({ url: `/wms/rdrecord11/get?id=` + id })
  },

  // 新增材料出库主
  createRdrecord11: async (data: Rdrecord11VO) => {
    return await request.post({ url: `/wms/rdrecord11/create`, data })
  },

  //提交
  submit: async (id: number) => {
    return await request.get({ url: `/wms/rdrecord11/startProcess?id=` + id })
  },

  // 修改材料出库主
  updateRdrecord11: async (data: Rdrecord11VO) => {
    return await request.put({ url: `/wms/rdrecord11/update`, data })
  },

  // 删除材料出库主
  deleteRdrecord11: async (id: number) => {
    return await request.delete({ url: `/wms/rdrecord11/delete?id=` + id })
  },

  // 导出材料出库主 Excel
  exportRdrecord11: async (params) => {
    return await request.download({ url: `/wms/rdrecord11/export-excel`, params })
  },

// ==================== 子表（材料出库子） ====================

  // 获得材料出库子列表
  getRdrecords11ListByOrderId: async (orderId) => {
    return await request.get({ url: `/wms/rdrecord11/rdrecords11/list-by-order-id?orderId=` + orderId })
  },
}
